#!/usr/bin/python
# -*- coding: UTF-8 -*-
import sys
list = [1,2,3,4]
it = iter(list)     # 创建迭代器对象
# print(next(it))     # 输出迭代器的下一个元素
# print(next(it))     #输出迭代器的下一个元素

# for x in it:
#     print(x, end=" ")


while True:
    try:
        print(next(it))
    except StopIteration:
        sys.exit()